<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en">
<head>
<title>产品中心</title>
<%@ include file="/jsp/common/commonJs.jsp"%>
</head>

<body>
	<%@ include file="/jsp/head_bus.jsp"%>
	<!--导航结束-->
	<!--内容开始-->

	<!--内容开始-->
<div class="cpzxBox ">
    <div class="bgImg1"></div>
    <div class="bgImg2"></div>
    <div class="bgImg3"></div>
    <div class="bgImg5"></div>
    <div class="CPZX">
        <div class="cpzxTit">
            <p class="cpzxTit-text">产品中心</p>
            <span class="cpaxLineL"></span>
            <span class="cpaxLine"></span>
            <span class="cpzxDown"></span>
            <span class="cpaxLine"></span>
            <span class="cpaxLineR"></span>
        </div>
        <div class="cpzxCont">
            <ul class="cpzxUl">
            	<c:forEach items="${list}" var="pro" varStatus="status">
            		<c:if test="${(status.index + 1) % 2 != 0}">
						<li class="cpzxLi cpzxLi1" id="${pro.id}">
		                    <span class="checkBg"></span>
		                    <div class="cpzxLiL fl">
		                        <h3>${pro.productName}</h3>
		                        <c:choose> 
								     <c:when test="${fn:length(pro.productDes) > 28}"> 
								     	 <p>${fn:substring(pro.productDes,0, 28)}......</p>
								     </c:when> 
								     <c:otherwise> 
								     	<p>${pro.productDes}</p>
								     </c:otherwise>
								</c:choose>
		                    </div>
		                    <div class="cpzxLiR fl">
		                        <span class="imgBox">
		                            <img src="http://${ip}/${pro.productImageUrl}">
		                        </span>
		                    </div>
		                </li>
		              </c:if>
		              
		              <c:if test="${(status.index + 1) % 2 == 0}">
		                <li class="cpzxLi" id="${pro.id}">
		                    <span class="checkBg"></span>
		                    <div class="cpzxLiL fl">
		                        <h3>${pro.productName}</h3>
		                        <c:choose> 
								     <c:when test="${fn:length(pro.productDes) > 28}"> 
								     	 <p>${fn:substring(pro.productDes,0, 28)}......</p>
								     </c:when> 
								     <c:otherwise> 
								     	<p>${pro.productDes}</p>
								     </c:otherwise>
								</c:choose>
		                    </div>
		                    <div class="cpzxLiR fl">
		                        <span class="imgBox">
		                            <img src="http://${ip}/${pro.productImageUrl}">
		                        </span>
		                    </div>
		                </li>
	                </c:if>
				</c:forEach>
            </ul>
        </div>
        <div class="cpzxBtn">
            <span class="cpzxBtnBuy" onclick="buy()">购买</span>
            <span class="cpzxBtnQX" onclick="cancle()">取消</span>
        </div>
    </div>
</div>
	<script src="${path}/static/js/product.js"></script>
	<script>
		function buy(){
			//var input=$("input[name=productId]").val();
			var obj=[];
			$("li").each(function(){
				//alert($(this).attr("class"));
				if($(this).attr("class")=='cpzxLi cpzxLi1 active' || $(this).attr("class")=='cpzxLi active'){
					obj.push($(this).attr("id"));
				}
			});
			//alert(obj);
			/* if(undefined==input){
				alert("请至少选择一项产品!");
				return;
			}
			$("input[name=productId]").each(function(){
				obj.push($(this).val());
			});*/
			if(obj.length>0){
				window.location.href="${path}/template/toOrder.do?productId="+obj;
			}else{
				alert("请至少选择一项产品！");
			}
			//alert(obj.length);
			//window.location.href="${path}/template/toOrder.do?productId="+obj;
		}
		
		function cancle(){
			$(".cpzxUl li").each(function(){
				 $(this).removeClass("active");
		         $(this).find(".checkBg").hide();
			});
		}
	</script>
<div class="footer" style="margin-top:0px;">
   <p>北京网视通联科技股份有限公司</p>
   <p>地址：北京市海淀区知春路京仪孵化器D座3层</p>
   <p>Copyright © 2004-2014 CCHVC云通-CDN全业务平台版权所有</p>
   <p>京ICP备14002150号-1 京公网安备1101080213237号</p>
</div>
</body>
</html>
